import { createApp } from "vue";
import App from "./App";
import store from "./store";
import router from "./router";
import Cookies from "js-cookie";

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import "virtual:svg-icons-register";
import elementIcons from "@/components/SvgIcon/svgicon";
import locale from "element-plus/es/locale/lang/zh-cn";
import piniaPersist from "pinia-plugin-persist";
import "@/assets/styles/index.scss";

import SlzqUi from "slzq-ui";
import "slzq-ui/style.css";

import "vue-ellipsis-tooltip/dist/style.css";
import vEllipsis from "vue-ellipsis-tooltip";

store.use(piniaPersist);
import "./permission";

import plugins from "./plugins";

import globalComponents from "./components";

import directives from "@/directive";

import install from "./directives"; // 引入并使用自定义指令

const app = createApp(App);

app
  .use(router)
  .use(store)
  .use(plugins)
  .use(directives)
  .use(ElementPlus, { locale, size: Cookies.get("size") || "default" })
  .use(elementIcons)
  .use(globalComponents)
  .use(install)
  .use(vEllipsis)
  .use(SlzqUi)
  .mount("#app");
